<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <%@include file ="../include/link.jsp"%> 
        <script language="javascript" type="text/javascript">
           /*  function deleteRole() {
                var r = window.confirm("确定要删除此角色吗？");
                document.getElementById("operate_result_info").style.display = "block";            
            } */
            function mod(id) {
				document.getElementById("hi").value=id;
				document.getElementById("hi").name="modify";
				document.getElementById("myform").submit();
			}
            function del(id) {
				document.getElementById("hi").value=id;
				document.getElementById("hi").name="delete";
				document.getElementById("myform").submit();
			}
        </script>
    </head>
    <body>
        <!--Logo区域开始-->
        <div id="header">
            <img src="../images/logo.png" alt="logo" class="left"/>
            <a href="${pageContext.request.contextPath}/view/login.jsp">[退出]</a>            
        </div>
        <!--Logo区域结束-->
        <!--导航区域开始-->
        <div id="navi">                        
            <ul id="menu">
                <%@include file ="../include/main.jsp"%>
            </ul>            
        </div>
        <!--导航区域结束-->
        <!--主要区域开始-->
        <div id="main">
            <form id="myform" action="${pageContext.request.contextPath}/role/RoleModiServlet" method="post">
                <!--查询-->
                <div class="search_add">
                    <input type="button" value="增加" class="btn_add" onclick="location.href='../view/role/role_add.jsp';" />
                </div>  
                <!--删除的操作提示-->
                <div id="operate_result_info" class="operate_success">
                    <img src="../images/close.png" onclick="this.parentNode.style.display='none';" />
                    删除成功！
                </div> <!--删除错误！该角色被使用，不能删除。-->
                <!--数据区域：用表格展示数据-->     
                <div id="data">                      
                    <table id="datalist">
                        <tr>                            
                            <th>角色 ID</th>
                            <th>角色名称</th>
                            <th class="width600">拥有的权限</th>
                            <th class="td_modi"></th>
                        </tr>  
                        <c:forEach items="${sessionScope.l}" var="ro">                    
                        <tr>                     
                            <td>${ro.rol_no}</td>
                            <td>${ro.rol_name}</td>
                            <td>${ro.perm}</td>
                            <td>
                                <input type="button" value="修改" class="btn_modify" onclick="mod(${ro.rol_no});"/>
                                <input type="button" value="删除" class="btn_delete" onclick="del(${ro.rol_no});" />
                            </td>                          
                        </tr>
                        </c:forEach>
                        <input type="hidden" id="hi"/>
                    </table>
                </div> 
                <!--分页-->
                <div id="pages">
        	        <a href="#">上一页</a>
                    <a href="#" class="current_page">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                    <a href="#">4</a>
                    <a href="#">5</a>
                    <a href="#">下一页</a>
                </div>
            </form>
        </div>
        <!--主要区域结束-->
        <div id="footer">
           
        </div>
    </body>
</html>